/*******************************************************************************
File Name  : cpu.h													  		  
Author     : whj			 											           		  
Date       : 2013/01/14  															  
Description:           
*******************************************************************************/
#ifndef _CPU_H
#define _CPU_H



/*******************************************************************************
 Basic variables type definition
 ******************************************************************************/

//#define uint8_t unsigned char
//#define int8_t  signed char

typedef  unsigned  char     INT8U;                        /*  8-bit unsigned integer                              */
typedef    signed  char     INT8S;                        /*  8-bit   signed integer                              */
typedef  unsigned  short    INT16U;                        /* 16-bit unsigned integer                              */
typedef    signed  short    INT16S;                        /* 16-bit   signed integer                              */
typedef  unsigned  int      INT32U;                        /* 32-bit unsigned integer                              */
typedef    signed  int      INT32S;                        /* 32-bit   signed integer                              */


/*******************************************************************************
 Macro definitions
 *******************************************************************************/
#define  OS_CRITICAL_METHOD   1

#if OS_CRITICAL_METHOD == 1
//#define  OS_ENTER_CRITICAL()  CPSIE i//{cpu_sr = OS_CPU_SR_Save();}
//#define  OS_EXIT_CRITICAL()   //{OS_CPU_SR_Restore(cpu_sr);}

//#define  OS_ENTER_CRITICAL()		CPSID i
//#define  OS_EXIT_CRITICAL()			CPSIE i
// __enable_irq() 
#define  OS_ENTER_CRITICAL()		asm(" CPSID i")
#define  OS_EXIT_CRITICAL()			asm(" CPSIE i")

#endif

//#define OS_ENTER_CRITICAL()     asm("   SETC    INTM")
//#define OS_EXIT_CRITICAL()      asm("   CLRC    INTM")

#endif
